<?php

$ticket ="gQGX8DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xLzh6aFkybkxsVTd3cXY1djYwaFNnAAIEkBYQWAMEAAAAAA==";

$url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".urlencode($ticket);

$imageInfo = downloadWeixinFile($url);

$filename = "qrcode.jpg";

$local_file = fopen($filename,'w');

if(false !== $local_file){
	
	if(false !==fwrite($local_file,$imageInfo["body"])){
		
		fclose($local_file);
		
	}
}

function downloadWeixinFile($url){
	
	
}
?>